function SuperType(name) {
    this.colors = ['red', 'green', 'blue']
    this.name = name
  }
  SuperType.prototype.sayName = function () {
      console.log(this.name);
  }

SubType.prototype =Object.create(SuperType.prototype)
SubType.prototype.constructor = SubType
SubType.prototype.sayName = function () {
    console.log(this.age);
}

function SubType(name,age) {
    SuperType.call(this,name)
    this.age = age
}

// console.log(SuperType.prototype); //{ sayName: [Function (anonymous)] }
// console.log(SubType.prototype);

var instance1 = new SubType('tom',20)
console.log(instance1);

var instance2 = new SubType('jack',21)
console.log(instance2);